home *** CD-ROM | disk | FTP | other *** search
/ Robotics & Artificial Int…3 (Professional Edition) / Robotics & Artificial Intelligence Tools 2003 (Professional Edition).iso / neural network tool and application / nsinstall.exe / data1.cab / Demos_Files / DLL / INPUT.C < prev    next >
Encoding:
C/C++ Source or Header  |  2002-03-08  |  1019 b   |  39 lines

  1. // Dynamic link library implementation of a generic input source
  2.  
  3. #include "NSDLL.h" 
  4.  
  5. #define data(i,j)        data[j+i*cols]
  6.  
  7. /***************************/
  8. /* Activation of component */
  9. __declspec(dllexport) void performInput(
  10.     DLLData    *instance,    // Pointer to instance data (may be NULL)
  11.     NSFloat    *data,         // Pointer to the data
  12.     int rows,         // Number of rows of data
  13.     int cols         // Number of cols of data
  14.     )
  15. {
  16.     int i,j;
  17.     for (i=0; i<rows; i++)
  18.         for (j=0; j<cols; j++)
  19.             data(i,j) = 0.0f;    // You define your own input source.
  20. }
  21.  
  22. /******************************************/
  23. /* Management of instance data (OPTIONAL) */
  24. /*
  25. __declspec(dllexport) DLLData *allocInput(
  26.     DLLData    *oldInstance,    // Pointer to the last instance if reallocating
  27.     int rows,         // Number of rows of data
  28.     int cols         // Number of cols of data
  29.     )
  30. {
  31.     DLLData *instance = allocDLLInstance(oldInstance);
  32.     return instance;
  33. }
  34.  
  35. __declspec(dllexport) void freeInput(DLLData *instance)
  36. {
  37.     freeDLLInstance(instance); 
  38. }
  39. */